/**
 * Created by Taow on 2017/9/26.
 */
import Vue from 'vue'
import VueResource from 'vue-resource';
Vue.use(VueResource);

export default {
  /*
   *报警记录分页查询
   */
  getAllAlartRecord(pageSize,pageNum,data){
    return Vue.http.post("/deviceMonitor/m/getAllDeviceWarnRecordList/"+pageSize+'/'+pageNum,data);
  },

  /*
   *报警数量
   */
  getWarnCounts(){
    return Vue.http.get("/deviceMonitor/m/getWarnCounts");
  },

  /*
   *获取感应床位信息
   */
  getOutBedInduction(deviceId){
    return Vue.http.get("/deviceMonitor/m/getBedDeviceInfo/"+deviceId);
  },

  /*
   *查询设备列表(床位监护页面分页接口)
   */
  getDeviceList(pageSize,pageNum,data){
    return Vue.http.post("/deviceMonitor/m/getBedDeviceList/"+pageSize+'/'+pageNum,data);
  },

  /*
   *获取报警设置
   */
  getAlarmSetUp(){
    return Vue.http.get("/deviceMonitor/m/getBedWarn");
  },

  /*
   *根据recordId获取报警记录详情
   */
  getAlarmRecordDetail(recordId){
    return Vue.http.get("/deviceMonitor/m/getDeviceWarnDetail/"+recordId);
  },

  /*
   *根据设备id获取报警记录
   */
  getAlarmRecord(pageSize,pageNum,deviceId){
    return Vue.http.get("/deviceMonitor/m/getDeviceWarnRecords/"+pageSize+"/"+pageNum+"/"+deviceId);
  },

  /*
   *获取楼层结构
*/
  getFloorStruct(type){
    return Vue.http.get("/deviceMonitor/m/getStructureBuildingFloor/"+type);
  },

  /*
   *获取报警设置
   */
  getAlarmSetUp(){
    return Vue.http.get("/deviceMonitor/m/getBedWarn");
  },
  /*
   *保存报警设置
   */
  saveAlarmSetUp(data){
    return Vue.http.post("/deviceMonitor/m/saveBedWarn",data);
  },

  /*
   *保存报警记录
   */
  saveAlarmRecord(data){
    return Vue.http.post("/deviceMonitor/m/saveWarnRecord",data);
  },

  /*
   *报警记录确认接口
   */
  confirmRecord(recordId){
    return Vue.http.get("/deviceMonitor/m/confirmRecord/"+recordId);
  },

  /**
   * 查询开启/关闭报警 状态
   */
  getDeviceEnableOrDisable(deviceId){
    return Vue.http.get("/deviceMonitor/m/getDeviceEnableOrDisable/"+deviceId);
  },

  /**
   * 开启/关闭报警
   */
  enableOrDisableDeviceBed(deviceId,lyingIsOpen,leavingIsOpen){
    return Vue.http.get("/deviceMonitor/m/enableOrDisableDeviceBed/"+deviceId+'/'+lyingIsOpen+'/'+leavingIsOpen);
  },
}
